﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerDash : MonoBehaviour
{
    public SpriteRenderer spriteRenderer;
    public float alphaSpeed = 0.02f;
    void Start()
    {
        spriteRenderer = GetComponent<SpriteRenderer>();
    }
    
    void Update()
    {
        Color color = spriteRenderer.color;
        color.a -= alphaSpeed;
        spriteRenderer.color = new Color(color.r, color.g, color.b, color.a);
        if (color.a <= 0f)
        {
            Destroy(gameObject);
        }
    }
}
